package CommonAlgs.sort;

public class BubbleSort {
    public static void main(String[] args) {
        int[] input = {5, 3, 5, 2, 8};
        solution(input);
    }

    private static void solution(int[] input) {
        for (int i = 0; i < input.length; i++) {
            for (int j = i+1; j < input.length-i; j++) {
                if (input[i]>input[j]){
                    int tmp = input[j];
                    input[j] = input[i];
                    input[i] = tmp;
                }
            }
        }
        for (int i : input) {
            System.out.print(i+"\t");
        }
    }
}
